<?php

namespace common\logics\trade\scope;

use Yii;

/**
 * 商城退款业务订单
 *
 * @author emhome <emhome@163.com>
 * @since 2.0
 */
class CompatibleScopeShopRefundOrder extends \common\models\shop\ShopOrderRefund implements CompatibleScopeInterface {

    /**
     * 商城订单统一退款申请编号
     * @return string
     */
    public function getOrderNo() {
        return $this->refund_no;
    }

    /**
     * 商城订单统一退款申请编号获取订单退款申请模型
     * @return static
     */
    public static function findByBizno($bizno) {
        return static::findOne([
            'refund_no' => $bizno
        ]);
    }

    /**
     * @inheritdoc
     */
    public function getCountdown() {
        return 0;
    }

    /**
     * @inheritdoc
     */
    public function getIsExpired() {
        return true;
    }

    /**
     * @inheritdoc
     */
    public function getMaxAllowCredit() {
        return 0;
    }

    /**
     * @inheritdoc
     */
    public function getTradeAmount() {
        return $this->refund_pay;
    }

    /**
     * @inheritdoc
     */
    public function getTradeTitle() {
        return '商城退款';
    }

    /**
     * @inheritdoc
     */
    public function getTradeDescription() {
        return '商城退款';
    }

    /**
     * @inheritdoc
     */
    public function getViewOrderId() {
        return $this->id;
    }

    /**
     * @inheritdoc
     */
    public function setPaying() {
        
    }

    public function getUserId() {
        return $this->user_id;
    }

}
